﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Model;
using Controller;

namespace Facade
{
    public class EmployeeFacade
    {
        public string Save(Employee Employees)
        {
            EmployeeController cont = new EmployeeController();
            return cont.Save(Employees);
        }

        public bool Save(List<Employee> Employees)
        {
            EmployeeController cont = new EmployeeController();
            return cont.Save(Employees);
        }

        public string Delete(Employee Employees)
        {
            EmployeeController cont = new EmployeeController();
            return cont.Delete(Employees);
        }

        public string BeforeDelete(Employee Employees)
        {
            EmployeeController cont = new EmployeeController();
            return cont.BeforeDelete(Employees);
        }

        public string UpdatePassword(Employee Employees, string Password)
        {
            EmployeeController cont = new EmployeeController();
            return cont.UpdatePassword(Employees, Password);
        }

        public IList<Employee> GetAll(string sSearch, int PageNumber, int DataLength, string SortCol, string SortDirection, out int TotalData, int BusinessGroupID)
        {
            IList<Employee> Employees = new List<Employee>();
            EmployeeController cont = new EmployeeController();
            Employees = cont.GetAll(sSearch, PageNumber, DataLength, SortCol, SortDirection, out TotalData, BusinessGroupID);
            return Employees;
        }

        public IList<Employee> GetAllHierarchy(string sSearch, int PageNumber, int DataLength, string SortCol, string SortDirection, out int TotalData, int CurrentUser)
        {
            IList<Employee> Employees = new List<Employee>();
            EmployeeController cont = new EmployeeController();
            Employees = cont.GetAllHierarchy(sSearch, PageNumber, DataLength, SortCol, SortDirection, out TotalData, CurrentUser);
            return Employees;
        }

        public IList<Employee> GetAllEmployeesByKPIAssignID(string sSearch, int KPIAssignID, int PageNumber, int DataLength, string SortCol, string SortDirection, out int TotalData)
        {
            IList<Employee> Employees = new List<Employee>();
            EmployeeController cont = new EmployeeController();
            Employees = cont.GetAllEmployeesByKPIAssign(sSearch, KPIAssignID, PageNumber, DataLength, SortCol, SortDirection, out TotalData);
            return Employees;
        }

        public IList<Employee> GetAllEmployeesByKPIAssignDtl(string sSearch, int KpiID, int PageNumber, int DataLength, string SortCol, string SortDirection, out int TotalData)
        {
            IList<Employee> Employees = new List<Employee>();
            EmployeeController cont = new EmployeeController();
            Employees = cont.GetAllEmployeesByKPIAssignDtl(sSearch, KpiID, PageNumber, DataLength, SortCol, SortDirection, out TotalData);
            return Employees;
        }

        public Employee GetEmployeeByID(int ID)
        {
            Employee Employees = new Employee();
            EmployeeController cont = new EmployeeController();
            Employees = cont.GetEmployeeByID(ID);
            return Employees;
        }

        public Employee GetEmployeeByName(string Name)
        {
            Employee Employees = new Employee();
            EmployeeController cont = new EmployeeController();
            Employees = cont.GetEmployeeByName(Name);
            return Employees;
        }

        public Employee GetEmployeeByKPIAssignDtlID(int KPIAssignDtlID)
        {
            Employee Employees = new Employee();
            EmployeeController cont = new EmployeeController();
            Employees = cont.GetEmployeeByKPIAssignDtlID(KPIAssignDtlID);
            return Employees;
        }

        public Employee GetSpvEmployeeByID(int ID)
        {
            Employee Employees = new Employee();
            EmployeeController cont = new EmployeeController();
            Employees = cont.GetSpvEmployeeByID(ID);
            return Employees;
        }

        public Employee GetEmployeeLogin(string Username, string Password)
        {
            Employee Employees = new Employee();
            EmployeeController cont = new EmployeeController();
            Employees = cont.GetEmployeeLogin(Username, Password);
            return Employees;
        }

        public IList<Employee> GetAssignedEmployeeByKPIID(int KPIID)
        {
            IList<Employee> Employees = new List<Employee>();
            EmployeeController cont = new EmployeeController();
            Employees = cont.GetAssignedEmployeeByKPIID(KPIID);
            return Employees;
        }

        public IList<Employee> GetUnderlingBySuperiorID(Employee Superior, string sSearch, int PageNumber, int Datalength, string SortCol, string SortDirection, out int TotalData)
        {
            IList<Employee> Employees = new List<Employee>();
            EmployeeController cont = new EmployeeController();
            Employees = cont.GetUnderlingBySuperiorID(Superior, sSearch, PageNumber, Datalength, SortCol, SortDirection,out TotalData);
            return Employees;
        }

        public IList<Employee> GetUnderlingBySuperiorID_TotalWeightKPI(Employee Superior, string sSearch, int PageNumber, int Datalength, string SortCol, string SortDirection, out int TotalData)
        {
            IList<Employee> Employees = new List<Employee>();
            EmployeeController cont = new EmployeeController();
            Employees = cont.GetUnderlingBySuperiorID_TotalWeightKPI(Superior, sSearch, PageNumber, Datalength, SortCol, SortDirection, out TotalData);
            return Employees;
        }

        public IList<Employee> GetUnderlingBySuperiorIDAdmin(int RgmTypeID, int RgmID, int BranchID, int SubBranchID, int DepartmentID, int SectionID
            , string sSearch, int PageNumber, int Datalength, string SortCol, string SortDirection, out int TotalData)
        {
            IList<Employee> Employees = new List<Employee>();
            EmployeeController cont = new EmployeeController();
            Employees = cont.GetUnderlingBySuperiorIDAdmin(RgmTypeID, RgmID, BranchID, SubBranchID, DepartmentID, SectionID, sSearch,PageNumber,Datalength,SortCol,SortDirection,out TotalData);
            return Employees;
        }


       
    }
}